<template>
	<view class="u-rela">
		<!-- 头像 姓名 年龄等 -->
		<div class="u-flex u-col-top">
			<u-image src="https://wxcode.sowreap.cn/nongmuWeChatImage/static/images/recruit/avatar.png" width="120rpx" height="120rpx" shape="circle"></u-image>
			<div class="u-flex-1 u-m-l-20">
				<view>
					<text class="u-font-48 blod" style="line-height: 1;">{{ dataList.name }}</text>
				</view>
				<view class="u-font-24 u-tips-color u-m-t-10">{{ dataList.category.title }}</view>
				<div class="u-flex u-font-26 u-m-t-20 label-wrap">
					<text>{{ handlerGender(dataList.gender) }}</text>
					<text>{{ calculateAge(dataList.birthday) }}岁</text>
					<text>{{ dataList.education }}</text>
				</div>
			</div>
			<view class="u-font-24 u-tips-color">{{ dataList.address }}</view>
		</div>
		<div class="line u-m-t-40"></div>
		<!-- 技能 -->
		<view class="u-m-t-50 skill-wrap">
			<div class="u-flex u-col-top">
				<!-- <text>1、</text> -->
				<text class="u-flex-1">{{ dataList.content }}</text>
			</div>
			<!-- <div class="u-flex u-col-top">
				<text>2、</text>
				<text class="u-flex-1">热爱学习，平时会主动学习，提高自己的职业相关技能。</text>
			</div>
			<div class="u-flex u-col-top">
				<text>3、</text>
				<text class="u-flex-1">善于与人沟通，良好的团队合作精神和高度的责任感，能够承受压力，有创新精神，保证工作质量。</text>
			</div>
			<div class="u-flex u-col-top">
				<text>4、</text>
				<text class="u-flex-1">对工作态度认真务实。</text>
			</div> -->

		</view>
		<!-- 求职期望 -->
		<div class="qiwang-wrap u-m-t-80">
			<div class="title u-flex">
				<text class="t-line"></text>
				<text class="blod">求职期望</text>
			</div>
			<view class="u-font-40 blod u-m-t-30 u-m-l-20">
				{{ dataList.category.title }}
			</view>
			<view class="salary u-m-t-30 u-m-l-20">{{ dataList.salary }}</view>
			<view class="u-flex">
				<view class="label-item u-m-t-30 u-m-l-20">
					{{ dataList.industry }}
				</view>
			</view>
		</div>
		<!-- 底部 -->
		<div class="footer-wrap">
			<div class="fixed-wrap u-flex u-row-between">
				<div class="btn">立即沟通</div>
			</div>
		</div>
	</view>
</template>

<script>
	export default {
		components: {},
		data() {
			return {
				dataList:{}
			}
		},
		onLoad(options) {
			if(options){
				// 查看申请人的简历详情
				this.get_recruit_showResume(options.resume_id)
			}
		},
		methods: {
			// 查看申请人的简历详情
			get_recruit_showResume(resume_id){
				this.$http({
					url:this.api.recruit_showResume,
					method:'GET',
					data:{
						resume_id
					}
				}).then(res=>{
					if(res.code == 1){
						this.dataList = res.data
					}
				})
			},
			
			// 判断性别函数
			handlerGender(num){
				if(num == 0){
					return '未知'
				}else if(num == 1){
					return '男'
				}else{
					return '女'
				}
			},
			
			// 根据出生日期计算年龄函数
			calculateAge(birthDate) {
			  const birth = new Date(birthDate);
			  const current = new Date();
			  let age = current.getFullYear() - birth.getFullYear();
			  const monthDifference = current.getMonth() - birth.getMonth();
			  if (monthDifference < 0 || (monthDifference === 0 && current.getDate() < birth.getDate())) {
			    age--;
			  }
			  return age;
			}
		}
	}
</script>

<style scoped lang="scss">
	// 找工作底部
	.footer-wrap {
		width: 750px;
		height: 180rpx;
		position: relative;
	
		.fixed-wrap {
			position: fixed;
			bottom: 0;
			left: 0;
			width: 750rpx;
			height: 160rpx;
			background: #FFFFFF;
			box-shadow: 0px 0px 32rpx 4rpx rgba(216,221,230,0.75);
			padding: 30rpx 45rpx;
			z-index: 9;
	
	
	
			.btn {
				width: 660rpx;
				height: 100rpx;
				background: #07C160;
				border-radius: 15rpx;
				display: flex;
				align-items: center;
				justify-content: center;
				font-size: 34rpx;
				font-family: PingFang SC;
				font-weight: bold;
				color:#fff;
			}
		}
		}
	
	.line {
		width: 750rpx;
		height: 1px;
		margin-left:-30rpx;
		background:#ddd;
	}
	.qiwang-wrap{
		width: 690rpx;
		background: #FFFFFF;
		box-shadow: 0px 0px 30rpx 0px rgba(8,14,95,0.1);
		border-radius: 15rpx;
		padding:40rpx 0;
	}

	.title {
		font-size: 32rpx;
		color: #272829;
		position: relative;
	}

	.label-wrap {
		text {
			width: 66rpx;
			height: 34rpx;
			background: #F3F3F3;
			border-radius: 17rpx;
			margin-right: 10rpx;
			display: flex;
			align-items: center;
			justify-content: center;
			font-size: 20rpx;
			color: #999999;
		}
	}

	.t-line {
		width: 5rpx;
		height: 24rpx;
		background: #07C160;
		border-radius: 3rpx;
		margin-right: 20rpx;
	}

	.label-item {
		padding: 10rpx;
		margin-right: 10rpx;
		background: #F3F3F3;
		border-radius: 5rpx;
		font-size: 24rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: #999999;
	}

</style>
<style>
	page {
		padding: 30rpx;
		background-color: #fff;

	}
</style>
